package com.chen.vo;


/**
 * @Author:chenao
 * @DATE:2022/3/2 17:17
 */

import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Result implements Serializable {
    private boolean success;
    private int code;
    private String msg;
    private Object data;
    private Long total;

    public static Result success(Object data) {
        return new Result(true, 200, "success", data,null);
    }

    public static Result success(Object data,Long total) {
        return new Result(true, 200, "success", data,total);
    }

    public static Result fail(int code, String msg) {
        return new Result(false, code, msg, null,null);
    }
}

